package com.dzsw.mybatisx.generate.util;

import org.apache.commons.collections4.MapUtils;

import java.util.HashMap;
import java.util.Map;

public class GenConf extends HashMap {

    public String getOutputPath() {
        return MapUtils.getString(this, "outputPath");
    }

    public String getAuthor() {
        return MapUtils.getString(this, "author");
    }

    public String getModuleName() {
        return MapUtils.getString(this, "moduleName");
    }

    public String getPkgParent() {
        return MapUtils.getString(this, "pkgParent");
    }

    public String getSuperMapperClass() {
        return MapUtils.getString(this, "superMapperClass");
    }

    public String getUrl() {
        return MapUtils.getString(getDsMap(), "url");
    }

    public String getDriverName() {
        return MapUtils.getString(getDsMap(), "driverName");
    }

    public String getUsername() {
        return MapUtils.getString(getDsMap(), "username");
    }

    public String getPwd() {
        return MapUtils.getString(getDsMap(), "pwd");
    }

    private Map<String, Object> getDsMap() {
        return MapUtils.getMap(this, "ds");
    }
}
